package interfaces.menu.joinGame.filters;

import fileHandling.language.options.OptionValues;
import interfaces.menu.joinGame.gamesTable.GamesTableWidget;
import interfaces.options.ComboBoxOptionWidget;

public abstract class TripleFilter extends Filter {
	
	private ComboBoxOptionWidget comboBox;
	
	public TripleFilter(ComboBoxOptionWidget filterWidget) {
		super(filterWidget);
		comboBox = filterWidget;
	}

	@Override
	public boolean passes(GamesTableWidget widget) {
		String value = comboBox.getValue();
		if(value.equals(OptionValues.Dont_Show.toString())) return filterDontShow(widget);
		else if(value.equals(OptionValues.Show_Only.toString())) return filterShowOnly(widget);
		return true;
	}
	
	protected abstract boolean filterDontShow(GamesTableWidget widget);
	
	protected abstract boolean filterShowOnly(GamesTableWidget widget);
}